package com.school.empsys.constants;

/**
 * 请假状态
 */
public enum LeavePermitStatus {

    SUBMIT(1, "SUBMIT", "提交"),
    PASS(2, "PASS", "通过"),
    NOTPASS(3, "NOTPASS", "不通过"),
    ;

    private Integer code;
    private String name;
    private String displayName;

    LeavePermitStatus(Integer code, String name, String displayName) {
        this.code = code;
        this.name = name;
        this.displayName = displayName;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDisplayName() {
        return displayName;
    }

    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    /**
     * 由String转到枚举值
     *
     * @return
     */
    public static LeavePermitStatus fromString(String value) {
        for (LeavePermitStatus certType : LeavePermitStatus.values()) {
            if (certType.getCode().toString().equals(value)) {
                return certType;
            }
        }
        return null;
    }

}
